using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace UTLBASEFORM
{
    public class CConfigurationManager
    {
        public CConfigurationManager() { }
        public static void WriteConfig(string strKeys, string strValue)
        {
          //  Configuration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
          //  cfg.AppSettings.Settings.Add(strKeys,strValue);
          //  cfg.Save(ConfigurationSaveMode.Modified);
          //  //ConfigurationManager.AppSettings[strKeys] = strValue;            
          //  //ConfigurationManager.AppSettings.Add(strKeys, strValue);
          ////  ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();

            fileMap.ExeConfigFilename = @"HongPhucGold.exe.config";  // relative path names possible

            // Open another config file

           // Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
            //ConfigurationSection ms = config.GetSection(""
          //  AppSettingsSection apps = config.GetSection("appSettings");

        }
        public static string ReadConfig(string strKeys)
        {
            return ConfigurationManager.AppSettings[strKeys];
        }
        
    }
}
